package com.springdemo.serializer;

import com.alibaba.fastjson.parser.DefaultJSONParser;
import com.alibaba.fastjson.parser.deserializer.ObjectDeserializer;
import com.springdemo.entity.User;

import java.lang.reflect.Type;

public class CodeDeserializer implements ObjectDeserializer {
    @Override
    public <T> T deserialze(DefaultJSONParser defaultJSONParser, Type type, Object o) {
        return (T) defaultJSONParser.parseObject(User.class);
    }

    @Override
    public int getFastMatchToken() {
        return 0;
    }
}
